﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shsc.Net.Common.Util;
using Shsc.Net.Common.Validator.Attributes;

namespace Shsc.Net.Common.Validator.Validators
{
    /// <summary>
    /// 
    /// </summary>
    public class RangeValidator : BaseValidator
    {

        public override bool DoValidate(object value, BaseValidationAttribute attribute)
        {
            RangeAttribute rangeAttribute = (RangeAttribute)attribute;
            return CheckUtil.CheckRange(value, rangeAttribute.Min, rangeAttribute.Max);
        }
    }
}
